home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine CD 1995 / Archive Magazine CD 1995.iso / discs / prog_disc / volume_5 / issue_08 / boota / !!ReadMe
Encoding:
Text File  |  1991-12-16  |  22.6 KB  |  548 lines

  1.  
  2. !BootA Version 2.00 - 15 December 1991
  3. --------------------------------------
  4.  
  5. CONTENTS OF THE BOOTA_ETC ARCHIVE
  6.  
  7. The BootA_Etc archive contains the !BootA application plus
  8. several other applications which provide examples of how to use
  9. !BootA. This document is also present in the archive. A read-only
  10. version of the Archive Filing System (ArcFS) is also provided,
  11. allowing you to run the example applications directly from the
  12. archive (the full read/write version of ArcFS is available from
  13. David Pilling, PO Box 22, Thorton Cleveleys, Blackpool, FY5 1LR).
  14.  
  15. To do this, first double click on the ArcFS icon to install the
  16. filing system, then double click on the BootA_Etc icon. A filer
  17. window will open showing the contents of the archive. You can now
  18. run applications directly from the archive in the same way as
  19. from any other filer window.
  20.  
  21. If you want to unpack the entire contents of the archive to
  22. another disk, it will require approximately 900K of disk space.
  23. However, in order to get working versions of !BootA and the
  24. example applications, you do not need to copy the 'C-source' or
  25. 'Unshared' directories. Without these, you will need less than
  26. 500K of disk space to accomodate !BootA and accompanying example
  27. applications.
  28.  
  29.  
  30. PURPOSE OF THIS DOCUMENT
  31.  
  32. This document is intended to provide an introduction to the
  33. !BootA application. The !Help file in the !BootA application
  34. directory provides reference information on using !BootA once you
  35. have read this introduction.
  36.  
  37.  
  38. INTRODUCTION TO !BOOTA
  39.  
  40. !BootA is a RISC OS desktop application which provides a simple
  41. front-end for running non WIMP-based applications and utilities
  42. as if they themselves were proper desktop applications.
  43.  
  44. Such utilities would normally have to be started by command
  45. outside the desktop environment, or from within an !Edit task
  46. window, or at the very least by pressing f12 in the desktop in
  47. order to enter the command.
  48.  
  49. By using !BootA as a front-end, the application or utility looks
  50. very much like any normal RISC OS desktop application. It has an
  51. application directory on which you double click to install the
  52. application on the icon bar, and you can then drag files to this
  53. icon for processing by the application.
  54.  
  55. All the applications accompanying !BootA (e.g. !Lock, !UnLock,
  56. etc) are actually examples of using !BootA as a front-end for non
  57. Wimp-based applications. These are referred to below (and in the
  58. !BootA !Help file) as 'client applications' to emphasise that
  59. they rely on !BootA to do many of the things for them that a real
  60. RISC OS desktop application does for itself.
  61.  
  62.  
  63. TRYING OUT !BOOTA
  64.  
  65. The !BootA application itself is set up so that when you double
  66. click on it, you install all these example 'client applications'.
  67. Normally, you would never do this. Rather, you would double click
  68. on whichever individual 'client application' you wanted to
  69. install. This would automatically start up !BootA, although no
  70. icon for !BootA itself would appear on the icon bar, only the
  71. icon for the client application.
  72.  
  73. However, on this occasion, to get a feel for the use of !BootA,
  74. double click on the !BootA icon to install the icons for all the
  75. example client applications. Then click the mouse menu button
  76. over these icons one by one, chosing 'Help' for each one. This
  77. will give you a brief summary of what each application does. You
  78. can also move the mouse pointer over the arrow at the right of
  79. the 'CmdOpts' option on these menus. This will display a dialogue
  80. box for entering additional input for the application. Some of
  81. the applications will have default 'CmdOpts' information, others
  82. will have none.
  83.  
  84. One of the icons installed on the icon bar will be for the !Dummy
  85. application, which does nothing but echo some information to your
  86. screen and is a silhouette of a dummy's face. Click on this to
  87. see what happens. Then drag to it any file or directory icon and
  88. again observe the result. Try changing the 'CmdOpts' information
  89. for !Dummy and repeating the above.
  90.  
  91.  
  92. SUMMARY OF !BOOTA FUNCTIONS
  93.  
  94. To summarise, !BootA provides the following services for its
  95. client applications:
  96.  
  97.  -  installing the client application's icon on the icon bar when
  98.     you double-click the mouse SELECT (or ADJUST) buttons on that
  99.     application's icon in a directory viewer window
  100.  
  101.  -  displaying a menu with a 'quit' choice when you click the
  102.     mouse MENU button on the installed icon, and removing it from
  103.     the icon bar if you chose this 'quit' option
  104.  
  105.  -  providing a 'help' option in the same menu and displaying a
  106.     brief help message if you chose this 'help' option
  107.  
  108.  -  running the client application when you click the mouse
  109.     SELECT or ADJUST buttons on the installed icon, or when you
  110.     drag a file or directory to it (clicking ADJUST over the
  111.     installed icon will also remove it from the icon bar)
  112.  
  113.  -  responding to requests for help text from the '!Help'
  114.     application (which displays the text in an 'Interactive help'
  115.     window)
  116.  
  117.  -  supplying additional input ('command options') to the client
  118.     application when it is run.
  119.  
  120.  -  changing the sprite used to display the client application
  121.     icon on the icon bar when requested to do so (see description
  122.     of BootAutil program below for more details of this).
  123.  
  124. As touched on above, you do not need to install the !BootA
  125. application before installing the first client application on the
  126. icon bar. !BootA is automatically activated when you double-click
  127. on a client application icon in the directory viewer window, and
  128. becomes resident in memory at that point.
  129.  
  130. Note that at this time, the client application itself has NOT
  131. been started and is NOT using any memory. Only !BootA is actually
  132. active and using memory. !BootA simply records the whereabouts of
  133. the client application directory so that it can issue the
  134. appropriate '*RUN' command when the time comes. However, this
  135. does mean that the client application directory must be
  136. accessible at that time - no problem with a hard disk, but with a
  137. floppy-disks RISC OS may call for the diskette to be re-inserted
  138. if it has been removed in the meantime.
  139.  
  140. When you install a second client application (by double clicking
  141. on its icon in a directory viewer), this initially causes another
  142. copy of !BootA to start-up, but this second copy immediately
  143. realises that the first copy is active and passes the
  144. responsibility for the client application to it and then shuts
  145. down. This means that only one copy of !BootA will be resident in
  146. memory regardless of the number of client applications installed
  147. Note: installing a large number of client applications may cause
  148. !BootA's memory allocation to expand as it adds details of the
  149. additional applications to its internal tables.
  150.  
  151. Double-clicking on the !BootA icon itself will cause !BootA to
  152. start up and to automatically install a list of client
  153. applications contained in the '!Init' file of the !BootA
  154. directory. This list is initially set up to include all the
  155. example client applications, so you should edit it to eliminate
  156. the ones you do not want installed in this way (note: !BootA will
  157. ignore any item in the list that begins with '|').
  158.  
  159. See the '!Help' file in the !BootA directory for more details.
  160.  
  161.  
  162. CONTENTS OF !BOOTA APPLICATION DIRECTORY
  163.  
  164. The !BootA application directory contains the following files:
  165.  
  166.     !Run       -  obey file to install and start up !BootA
  167.     !RunImage  -  !BootA application program
  168.     !Sprites   -  sprite file containing !BootA sprite
  169.     !Help      -  help text (displayed when HELP chosen from filer menu)
  170.     !Init      -  list of clients installed by !Run
  171.     !Auto      -  suggested list of clients to start
  172.                   automatically from the desktop boot file
  173.     BootAutil  -  additional utility for dynamically changing
  174.                   sprite used for client application icon on icon
  175.                   bar (see below for more details)
  176.  
  177. SUMMARY OF THE EXAMPLE CLIENT APPLICATIONS
  178.  
  179. The following example client applications accompany !BootA:
  180.  
  181.     !Dummy     -  demonstrates how a client application works
  182.     !FileInfo  -  issues *FILEINFO command against a file
  183.     !Ex        -  issues *EX command against a directory
  184.     !SetType   -  issues *SETTYPE command against a file
  185.     !Lock      -  issues *ACCESS ... LR command against a file
  186.     !UnLock    -  issues *ACCESS ... WR command against a file
  187.     !SetDir    -  sets the curently selected directory
  188.     !CCompile  -  invokes the Acorn ANSI C compiler
  189.     !Compare   -  compares two files
  190.     !1stMake   -  converts text file to 1stWord+ file
  191.     !1stUnMake -  converts 1stWord+ file to text file
  192.     !BasicEdit -  loads Basic program file into the Basic Editor
  193.     !Twin      -  loads file into the Twin editor
  194.     !ARCtoIBM  -  changes end-of-line delimiters from LF to CRLF
  195.     !IBMtoARC  -  changes end-of-line delimiters from CRLF to LF
  196.     !BootA     -  removes IBM mainframe style line numbers from file
  197.  
  198. See  below for more details of these client applications.
  199.  
  200. The client application directories will typically contain the
  201. following files:
  202.  
  203.     !Run       -  obey file to start up !BootA to install client icon
  204.     !RunA      -  obey file used by !BootA to run the client appl.
  205.     !HelpMsg   -  text for menu 'help' option & interactive !Help
  206.     !CmdOpts   -  initial value for command options data
  207.     !Sprites   -  usual RISC OS application sprites file
  208.     !Boot      -  usual RISC OS application boot file
  209.     !RunImage  -  application program
  210.  
  211. Of these files, only '!Run' and '!RunA' are mandatory. All the
  212. others are optional, depending on the requirements of the
  213. particular client application.
  214.  
  215. !BootA requires a minimum of 32K of memory. This is enough to
  216. install approximately ten to fourteen client applications,
  217. depending on the amount of help message text and command options
  218. text in total. This memory allocation will automatically expand
  219. if more space is needed, taking it from the computer's free
  220. memory (a feature of the shared C-library version 3.75 or later).
  221. If there is no more free memory, !BootA will display a normal
  222. Wimp_ReportError message and then terminate (which will
  223. automatically de-install all the client icons).
  224.  
  225.  
  226. C-SOURCE AND UNSHARED DIRECTORIES
  227.  
  228. In addition to the example applications, there are two non-
  229. application directories accompanying !BootA: the 'C-source'
  230. directory and the 'Unshared' directory.
  231.  
  232. The 'C-source' directory contains the C source and header files
  233. for the 1stMake, 1stUnMake, ARCtoIBM, IBMtoARC, UnNum and BootA
  234. application programs, plus two files of common functions:
  235. ArgFuncs and GetDirs (note that the source files have a file type
  236. of "00C" and the header files a file type of "00D" - this is a
  237. whim of mine and these filetypes correspond to sprites contained
  238. in the !CCompile application). It also contains the assembler
  239. source for the BootAutil program (which was assembled using the
  240. Acorn AAsm assembler), and the make files for the above.
  241.  
  242. The directory "UnShared" contains versions of the !1stMake,
  243. !1stUnMake, !ARCtoIBM, !IBMtoARC, !UnNum and !BootA applications
  244. which do not use the shared C library. Instead the library
  245. functions are linked directly into the image file. This makes
  246. them bigger, but they will work if you do not have the correct
  247. version of the shared C library installed on your system. If you
  248. use the version of !BootA in this directory, it requires 80K of
  249. memory to run.
  250.  
  251.  
  252. ADDITIONAL DETAILS OF THE EXAMPLE CLIENT APPLICATIONS
  253.  
  254. Most of these client applications are (deliberately) trivial in
  255. order to provide simple examples of the use of !BootA. Some of
  256. them are useless, or outclassed by other generally available
  257. applications, or obsoleted by RISC OS 3. Some may actually be
  258. useful.
  259.  
  260.  
  261. (1)  !Dummy application
  262.  
  263.      This example application does nothing but display
  264.      information on the screen using 'Echo' commands in its !RunA
  265.      file. This information includes a mock-up of the command
  266.      that !BootA generates to start up a client application, so
  267.      providing an insight into how a client application is run.
  268.      This is achieved by the following command in the !RunA
  269.      file for !Dummy:
  270.  
  271.           Echo *WimpTask Run <Obey$Dir>.!RunA %*0
  272.  
  273.      which, after the values assigned to 'Obey$Dir' and '%*0'
  274.      have been substituted for the variables, will display the
  275.      equivalent of the command issued internally by !BootA.
  276.  
  277.      After installing the !Dummy icon (by double clicking on it),
  278.      just drag to it the icon for any file, directory or
  279.      application directory to see what 'Run' command will result.
  280.      Experiment with changing the 'CmdOpts' value (via the
  281.      'CmdOpts' option on the menu) to see how this is inserted
  282.      into the command.
  283.  
  284.      The !RunA file also includes other 'Echo' commands to
  285.      display the system variables set by !BootA before issuing
  286.      the 'Run' command.
  287.  
  288.  
  289. (2)  !FileInfo application
  290.  
  291.      This trivial example provides a quick means of issuing the
  292.      '*FileInfo' command against a file (or directory). The !RunA
  293.      file includes the following command:
  294.  
  295.           FileInfo %*0
  296.  
  297.      It is, of course, obsoleted by RISC OS 3, which provides an
  298.      'Info' option on its filer menu.
  299.  
  300.  
  301. (3)  !Ex application
  302.  
  303.      This trivial example provides a quick means of issuing the
  304.      EX command against a directory. The !RunA file includes the
  305.      following command:
  306.  
  307.           Ex <BootA$Dir>
  308.  
  309.      making use of one of the system variables set by !BootA
  310.      before running the client application. If a file is dragged
  311.      to the !Ex icon, then the result will be an '*EX' command
  312.      issued for the directory containing that file.
  313.  
  314.  
  315. (4)  !SetType application
  316.  
  317.      This example shows how easy it is to set up a simple
  318.      application using a 'CmdOpts' value. The !RunA file contains
  319.      the command:
  320.  
  321.           Settype %*0
  322.  
  323.      and the !CmdOpts file contains the default filetype of
  324.      'text'. Dragging a file to the installed 'SetType' icon will
  325.      set that file's type to 'text'. Update the 'CmdOpts' data
  326.      via menu option 'CmdOpts' to chose a different type. This
  327.      application is less sophisticated than many of the 'SetType'
  328.      applications already in the public domain and is obsoleted
  329.      by RISC OS 3 which has a 'Set type' option on the filer
  330.      menu.
  331.  
  332.  
  333. (5)  !Lock application
  334.  
  335.      This !RunA file for this application includes the command:
  336.  
  337.           Access %*0
  338.  
  339.      and the CmdOpts value is set to 'LR'. Drag any file or
  340.      directory icon to the !Lock icon to lock the file. This can
  341.      often be much quicker and convenient than using the 'Access'
  342.      option from the filer menu. This application is also
  343.      obsoleted by RISC OS 3, which has a much more convenient
  344.      'Access' option on the filer menu.
  345.  
  346.  
  347. (6)  !UnLock application
  348.  
  349.      This is almost identical to the !Lock application. The only
  350.      difference is that CmdOpts value is set to 'WR' and the
  351.      !Sprites file contains a different icon. Drag any file or
  352.      directory icon to the !Unlock icon in order to unlock it.
  353.      Like !Lock, this application is obsoleted by RISC OS 3.
  354.  
  355.  
  356. (7)  !SetDir application
  357.  
  358.      Drag a directory to the installed SetDir icon to make that
  359.      directory the 'current' directory. Dragging a file instead
  360.      of a directory will set the current directory to the
  361.      directory containing the dragged file. Click on the
  362.      installed SetDir icon to set the root directory of the
  363.      current drive as the current directory.
  364.  
  365.  
  366. (8)  !CCompile application
  367.  
  368.      This application will invoke the AcornSoft ANSI C compiler
  369.      to compile a C source file (assuming you have the C compiler
  370.      installed in the library on your system!). The current
  371.      directory is set to the parent of the one containing the
  372.      dragged file (according to the normal practice for using the
  373.      ANSI C compiler). The 'CmdOpts' are initially set to
  374.      '-c -list' so that only compilation occurs and a compilation
  375.      listing is generated (including any error messages).
  376.  
  377.  
  378. (9)  !Compare application
  379.  
  380.      Drag two files to this icon to compare them to see if they
  381.      are the same. The !RunA file invokes a program in the same
  382.      directory to perform the actual comparison. This program is
  383.      a very simple comparison utility which reports if the file
  384.      contents and catalog information match. This example shows
  385.      how easy it is to process two files by writing a !RunA obey
  386.      file to save the details of the first file dragged to it
  387.      until a second is dragged. The !RunA obey file for this
  388.      client application also contains commands to run the
  389.      BootAutil program in order to change the sprite used for
  390.      the !Compare icon on the icon bar.
  391.  
  392.  
  393. (10) !1stMake application
  394.  
  395.      Drag a text file to the installed 1stMake icon to convert it
  396.      to a 1stWord+ document. Click on the 1stMake icon to see the
  397.      syntax of the 1stMake command. This application shows how a
  398.      traditional command orientated utility (which 1stMake is)
  399.      can be set up as a convenient-to-use desktop application.
  400.  
  401.  
  402. (11) !1stUnMake application
  403.  
  404.      Drag a 1stWord+ document file to the installed 1stUnMake
  405.      icon to convert it to a plain text file. Click on the
  406.      1stUnMake icon to see the syntax of the 1stUnMake command.
  407.      This application is just the reverse of 1stMake and is
  408.      similarly structured.
  409.  
  410.  
  411. (12) !BasicEdit application
  412.  
  413.      Drag a basic program file here to load it into the Basic
  414.      Editor (a text file can also be dragged and will be
  415.      automatically tokenised by BASIC). The current directory is
  416.      set to the directory containing the dragged file (and
  417.      restored afterwards). The !RunA file also sets two function
  418.      keys - f4 to issue an '*QUIT' command (to return to the
  419.      desktop after returning from the Basic Edit to BASIC) and f2
  420.      to issue an 'EDIT.' command (to re-invoke the Basic Editor
  421.      after returning to BASIC). This application is obsoleted by
  422.      the version of !Edit in RISC OS 3, which provides a desktop
  423.      compliant way of editing BASIC programs.
  424.  
  425.  
  426. (13) !Twin application
  427.  
  428.      This application assumes you have Twin installed in the ADFS
  429.      library on your system. Drag a file here to load it into
  430.      Twin, set the colours to a nice (?) yellow on black and set
  431.      the current directory to the directory containing the
  432.      dragged file (and restore it afterwards). There are still
  433.      some things that Twin does better than anything else!
  434.  
  435.  
  436. (14) !ARCtoIBM
  437.  
  438.      This application changes Archimedes end-of-line characters
  439.      (LF) to DOS format end-of-line characters (CRLF). Drag a
  440.      file here to convert it and replace the existing file with
  441.      the updated file. Drag a directory here to convert all the
  442.      files therein.
  443.  
  444.  
  445. (15) !IBMtoARC
  446.  
  447.      This application changes DOS format end-of-line characters
  448.      (CRLF) to Archimedes end-of-line characters (LF). Drag a
  449.      file here to convert it and replace the existing file with
  450.      the updated file. Drag a directory here to convert all the
  451.      files therein.
  452.  
  453.      With RISC OS 3, you can use this to convert DOS files in-
  454.      situ on the DOS diskette, then edit the files using !Edit
  455.      without the annoying '[0d]' at the end of each line, and
  456.      finally convert the edited files back to DOS mode again in-
  457.      situ by using !ARCtoIBM.
  458.  
  459.  
  460. (16) !UnNum application
  461.  
  462.      This application deletes line sequence numbers from IBM
  463.      mainframe style files. It is obviously a specialised
  464.      utility which was written to meet a particular need. Drag a
  465.      text file to the !UnNum icon after it has been installed on
  466.      the icon bar to 'unnumber' it, or drag a directory to the
  467.      !UnNum icon to 'unnumber' all text files in the directory.
  468.      These text files must be correctly sequenced numbered in the
  469.      first place and must not contain any unprintable characters
  470.      or they will be rejected by !UnNum.
  471.  
  472.  
  473. BOOTAUTIL PROGRAM
  474.  
  475. This program is included in the !BootA application directory and
  476. can be executed from a client application's !RunA file by issuing
  477. a command such as the following:
  478.  
  479.      *Run <BootA$Appl>.BootAutil -sprite newname
  480.  
  481. which will send a message to BootA requesting that sprite 'newname'
  482. should be used for displaying the client application's icon on the
  483. icon bar. The sprite 'newname' must already be loaded into the Wimp
  484. sprite pool (best done by including it in the !sprites file for the
  485. client application).
  486.  
  487. The !Compare application provides an example of the use of
  488. BooyAutil. When first installed by BootA, the sprite used to
  489. display its icon on the icon bar is '!compare'. As soon as a file
  490. is dragged to this icon, the sprite is changed to 'compare0' to
  491. indicate that it is now waiting for the second file. When a
  492. second file is so dragged, the sprite is changed to 'compare1'
  493. and the comparison takes place. When the comparison is finished
  494. (or if you click on the icon to 'reset' it, rather than dragging
  495. a file to it), the sprite is changed back to '!compare'. The
  496. !sprites file for !Compare contains all three sprites:
  497. '!compare', 'compare0' and 'compare1'; so that when the directory
  498. viewer first sees the !Compare application directory, all three
  499. sprites are loaded into the Wimp sprite pool.
  500.  
  501. When using replacement sprites in this way, all should be of the
  502. same size. The icon bounding box will be set by the first sprite
  503. displayed (i.e. the sprite with the same name as the application
  504. itself).
  505.  
  506. BootAutil has a file type of 'absolute' which means that when run
  507. it loads into the application workspace at &8000. This is the
  508. same area used by other application programs (e.g. programs
  509. written in Basic, C, etc), so that it is not a good idea to issue
  510. the command to run BootAutil from within such an application
  511. program as BootAutil will replace the issuing program in the
  512. application workspace (although it could be used as a way of
  513. intentionally ending the application and updating its icon on the
  514. icon bar at the same time). BootAutil should normally be run from
  515. the client application's !RunA obey file.
  516.  
  517. BootAutil accepts three arguments:
  518.  
  519.      -sprite xxxx  -  specifies name of sprite to be used (sprite
  520.                       should already be loaded into the Wimp
  521.                       sprite pool)
  522.  
  523.      -quit         -  requests BootA to remove the client's icon
  524.                       from the icon bar (same effect as 'Quit' on
  525.                       the menu)
  526.  
  527.      -handle nnnn  -  supplies the handle identifying the
  528.                       client's icon; BootA sets system variable
  529.                       'BootA$Handle' to this handle before
  530.                       running the client's !RunA obey file; if
  531.                       '-handle' is not specified then BootAutil
  532.                       uses the value of the system variable.
  533.  
  534.  
  535. COPYRIGHT NOTICE
  536.  
  537. BootA, BootAutil, 1stMake, 1stUnMake, ARCtoIBM, IBMtoARC and UnNum
  538. are subject to Copyright.
  539.  
  540. Permission is granted by the author to any recipient of this
  541. material to use and make/disseminate copies of the application
  542. provided that no charges are made for doing so (other than to
  543. cover any cost of media or postage) and that this notice is
  544. included with all copies.
  545.  
  546. Paul Witheridge  - 15 December 1991.
  547.  
  548.